module instMemory(
	iClk,
	iIRWrite,
	iMemWrite,
	iInstAddress,		// PC-counter의 출력. Instruction의 주소(4의 배수)
	iInstInput,
	oInstruction		// target instruction
	);
	
	input iClk, iMemRead, iMemWrite;
	input [7:0] iInstAddress, iInstInput;
	output [31:0] oInstruction;
   
	reg [7:0] regMem [255:0]; // 8-bit address, 8-bit Memory. (256-word) Capable of saveing 64-instruction.
	
	assign oInstruction = (iIRWrite)?{ regMem[iInstAddress], regMem[iInstAddress + 5'd1], regMem[iInstAddress + 5'd2], regMem[iInstAddress + 5'd3] };
		
	always @(posedge iClk)
		begin
			if(iMemWrite) regMem[iInstAddress] <= iInstInput;	
		end

endmodule
